package com.jn.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import com.jn.datasource.DBContextHolder;

/**
 * @ClassName AopAspect
 * @Description AOP支持
 * @author liuxd
 * @date 2013年12月4日 下午12:23:17
 * 
 */
@Aspect
@Component
public class AopAspect {

	@Before("execution(* com.jn.service.hollyService.SdccService.*(..))")
	public void sdccBefore(JoinPoint jp) {
		DBContextHolder.setDBType(DBContextHolder.DATA_SOURCE_SDCC);
	}

	@Before("execution(* com.jn.service.hollyService.SddwService.*(..))")
	public void sddwBefore(JoinPoint jp) {
		DBContextHolder.setDBType(DBContextHolder.DATA_SOURCE_SDDW);
	}

	@Before("execution(* com.jn.service.hollyService.VacService.*(..))")
	public void vacBefore(JoinPoint jp) {
		DBContextHolder.setDBType(DBContextHolder.DATA_SOURCE_VAC);
	}

	@Before("execution(* com.jn.service.hollyService.WqtService.*(..))")
	public void wqtBefore(JoinPoint jp) {
		DBContextHolder.setDBType(DBContextHolder.DATA_SOURCE_WQT);
	}
	
	@Before("execution(* com.jn.service.hollyService.EciaService.*(..))")
	public void eciaBefore(JoinPoint jp){
		DBContextHolder.setDBType(DBContextHolder.DATA_SOURCE_ECIA);
	}

}
